<%--
  ~ Licensed to Jasig under one or more contributor license
  ~ agreements. See the NOTICE file distributed with this work
  ~ for additional information regarding copyright ownership.
  ~ Jasig licenses this file to you under the Apache License,
  ~ Version 2.0 (the "License"); you may not use this file
  ~ except in compliance with the License.  You may obtain a
  ~ copy of the License at the following location:
  ~
  ~   http://www.apache.org/licenses/LICENSE-2.0
  ~
  ~ Unless required by applicable law or agreed to in writing,
  ~ software distributed under the License is distributed on an
  ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  ~ KIND, either express or implied.  See the License for the
  ~ specific language governing permissions and limitations
  ~ under the License.
  --%>
<%@ page contentType="text/html; charset=UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <!-- 上述3个meta标签*必须*放在最前面，任何其他内容都*必须*跟随其后！ -->
    <title>登录</title>
<%-- <link rel="shortcut icon" href="<%=request.getContextPath()%>/css/images/favicon.ico" type="image/x-icon" /> --%>
	<link href="<%=request.getContextPath()%>/css/newstyle.css" type="text/css" rel="stylesheet" />
	<link href="<%=request.getContextPath()%>/css/webbasic.css" type="text/css" rel="stylesheet" />
    <link href="<%=request.getContextPath()%>/js/bootstrap/css/bootstrap.min.css" rel="stylesheet">
    <link href="<%=request.getContextPath()%>/font-awesome/css/font-awesome.min.css" rel="stylesheet">	
	
<script type="text/javascript" src="<%=request.getContextPath()%>/js/dashboard/jquery-2.0.3.min.js"></script>
<script type="text/javascript" src="<%=request.getContextPath()%>/js/bootstrap/bootstrap.min.js"></script>
<script type="text/javascript" src="<%=request.getContextPath()%>/js/jquery/md5.js"></script>	
<script type="text/javascript">
$(document).ready(function(){	
	var error = '${param.login_error}';
	if(error == '1'){
		$("#errorDiv").css("visibility", "visible");
	}
});

function doin(){  
    var password= $("input[name='test']").val();
    var hash = hex_md5(password);
    $("input[name='j_password']").val(hash);
    $("input[name='test']").attr("disabled","true");
    $("#my_login_form_test").submit();
}  
</script>
</head>
<body class="gray-bg">
    <div class="middle-box text-center loginscreen animated fadeInDown">
        <div>
            <div>
                <div class="logo-name"><img src="image/TDS-ICON.png" width="350" height="162" alt=""/></div>
            </div>
            <h3>欢迎来到TDS</h3>
            <p>群顶分布式存储
            </p>
            <p>登录</p>
            <div style="visibility: hidden;color:#ff0000;" id="errorDiv">用户名或密码错误！请重新输入！</div>
            <form class="m-t" role="form" id='my_login_form_test' name='f' action='<%=request.getContextPath()%>/j_spring_security_check' method='POST'>
                <div class="form-group">
                    <input type="text" class="form-control" name='j_username' placeholder="账号" required="">
                </div>
                <div class="form-group" style="margin-top: 20px;">
                	<input type="hidden" name='j_password'>
                    <input type="password" class="form-control" name='test' placeholder="密码" required="">
                </div>
                <button type="submit" class="btn btn-primary block  m-b" style="width: 100%;margin-top: 15px;" id="submitbtn" onclick="doin()">登录</button>
                <!-- <a href="#"><small>忘记密码？</small></a> -->
            </form>
            <p class="m-t"> <small>Copyright © 2015 南京群顶科技有限公司</small> </p>
        </div>
    </div>
</body>
</html>